﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Index/Index_Two.master" AutoEventWireup="true" CodeFile="AccountList.aspx.cs" Inherits="Account_AccountList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="Server">
    账号管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Info" runat="Server">
    <span>日期：2014年2月28日</span>
    <span>管理员：XXX</span>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Map" runat="Server">
    <a href="../Main.aspx">首页</a>
    <span>&gt;&gt;</span>
    <span>康复评估</span>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Tool" runat="Server">
    <%--<a href="#" class="ui-btn rightCol">查询</a>
    <div class="ui-text-search rightCol">
        <input type="text" class="ui-text-search-input" />
        <span class="ui-text-search-drop">姓名</span>
    </div>--%>

    <asp:Button ID="btn_Add" runat="server" CssClass="ui-btn" Text="注册" OnClick="btn_Add_Click" />
    <asp:Button ID="btn_Edit" runat="server" CssClass="ui-btn" Text="编辑" OnClick="btn_Edit_Click" OnClientClick="return Add()"/>
    <asp:Button ID="btn_Del" runat="server" CssClass="ui-btn" Text="删除" OnClick="btn_Del_Click" OnClientClick="return Del()"/>
    <asp:HiddenField ID="hf_SelectedUserId" runat="server" Value="-1" />
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Main_Left_Title" runat="Server">
    账号信息
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Main_Left" runat="Server">
    <div class="ui-panel-detail">
        <div class="ui-title">
            <h1>基本信息</h1>
        </div>
        <table class="ui-panel-detail-table">
            <tr>
                <th>姓&nbsp;&nbsp;&nbsp;&nbsp;名：</th>
                <td><span id="lbl_UserName"></span></td>
            </tr>
            <tr>
                <th>性&nbsp;&nbsp;&nbsp;&nbsp;别：</th>
                <td><span id="lbl_Gender"></span></td>
            </tr>
            <tr>
                <th>出生年月：</th>
                <td><span id="lbl_Birthday"></span></td>
            </tr>
            <tr>
                <th>账&nbsp;&nbsp;&nbsp;&nbsp;号：</th>
                <td><span id="lbl_Account"></span></td>
            </tr>
            <%--<tr>
                <th>密&nbsp;&nbsp;&nbsp;&nbsp;码：</th>
                <td>123456</td>
            </tr>--%>
            <tr>
                <th>科&nbsp;&nbsp;&nbsp;&nbsp;室：</th>
                <td><span id="lbl_Department"></span></td>
            </tr>
            <tr>
                <th>职&nbsp;&nbsp;&nbsp;&nbsp;务：</th>
                <td><span id="lbl_Post"></span></td>
            </tr>
            <tr>
                <th>联系电话：</th>
                <td><span id="lbl_Phone"></span></td>
            </tr>
            <tr>
                <th>证&nbsp;件&nbsp;号：</th>
                <td><span id="lbl_CertificateNo"></span></td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="Main_Right_Title" runat="Server">
    账号管理
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="Main_Right" runat="Server">
    <div class="ui-panel-grid">
        <asp:Repeater ID="RepeaterList" runat="server"
            OnItemCommand="RepeaterList_ItemCommand"
            OnItemDataBound="RepeaterList_ItemDataBound">
            <HeaderTemplate>
                <table class="ui-grid" id="grid">
                    <tr>
                        <th style="display: none">选择</th>
                        <th>序号</th>
                        <th>账号</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th style="display: none">出生年月</th>
                        <th style="display: none">科室</th>
                        <th>职务</th>
                        <th style="display: none">证件号</th>
                        <th>联系电话</th>
                        <th>权限</th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td style="display: none">
                        <input type="radio" name="UserId" value="<%#Eval("UserId") %>" /></td>
                    <td><%#Container.ItemIndex+1 %></td>
                    <td class="Account"><%#Eval("Account") %></td>
                    <td class="UserName"><%#Eval("UserName") %></td>
                    <td class="Gender"><%#GetGenderText(Convert.ToInt32(Eval("Gender"))) %></td>
                    <td class="Birthday" style="display: none"><%#Eval("Birthday") %></td>
                    <td class="Department" style="display: none"><%#Eval("Department") %></td>
                    <td class="Post"><%#Eval("Post") %></td>
                    <td class="CertificateNo" style="display: none"><%#Eval("CertificateNo") %></td>
                    <td class="Phone"><%#Eval("Phone") %></td>
                    <%--<td class="Role"><%#Eval("RoleCode")=="002"?"管理员":"无" %></td>--%>
                    <td class="Role"><%#Eval("RoleCode").ToString()=="002"?"管理员":"无" %></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
    <div class="ht-pager">
        <webdiyer:AspNetPager ID="PaginateCtl" runat="server" OnPageChanged="PaginateCtl_PageChanged" />
    </div>


    <script type="text/javascript">
        $(function () {
            $("#grid tr").click(function () {

                $(this).find("input[type=radio]").attr("checked", "checked");
                $('#<%=hf_SelectedUserId.ClientID %>').val($(this).find("input[type=radio]").val());

                $("#grid tr").removeClass("selected");
                $(this).addClass("selected");

                //显示左边信息栏信息
                $("#lbl_Account").text($(this).find(".Account").text());
                $("#lbl_UserName").text($(this).find(".UserName").text());
                $("#lbl_Gender").text($(this).find(".Gender").text());
                $("#lbl_Birthday").text($(this).find(".Birthday").text());
                $("#lbl_Department").text($(this).find(".Department").text());
                $("#lbl_Post").text($(this).find(".Post").text());
                $("#lbl_CertificateNo").text($(this).find(".CertificateNo").text());
                $("#lbl_Phone").text($(this).find(".Phone").text());
            });
        });

        function Add() {
            if ($('#<%=hf_SelectedUserId.ClientID %>').val() < 1) {
                alert("请选择要操作的账号！");
                return false;
            }
            return true;
        }

        function Del() {
            if ($('#<%=hf_SelectedUserId.ClientID %>').val() < 1) {
                alert("请选择要操作的账号！");
                return false;
            }
            return confirm('确认要删除该数据吗？');
        }
    </script>
</asp:Content>

